package com.lqd.mall.log.service;

import com.lqd.mall.basis.constant.SecurityConstants;
import com.lqd.mall.basis.constant.ServiceNameConstants;
import com.lqd.mall.basis.response.CommonResult;
import com.lqd.mall.interaction.system.SysOperLogEntity;
import com.lqd.mall.log.service.factory.RemoteSysOperLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author 零起点
 * @create 2022-03-02 22:38
 */
@FeignClient(contextId = "remoteSysLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysOperLogFallbackFactory.class)
public interface RemoteSysOperLogService {
    @PostMapping("/operlog/save")
    CommonResult save(@RequestBody SysOperLogEntity entity,
                      @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
